<template>
  <div class="dashboard-editor-container">
    <!-- <github-corner></github-corner> -->

    <panel-group @handleSetLineChartData="handleSetLineChartData"></panel-group>

    <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
      <H3><span style="color: #00aaaa">环比数据量化图</span></H3>
      <line-chart :chart-data="lineChartData"></line-chart>
    </el-row>


  </div>
</template>

<script>
// import GithubCorner from '@/components/GithubCorner'
import PanelGroup from './PanelGroup'
import LineChart from './LineChart'

const lineChartData = {
  newVisitis: {
    expectedData: [100, 120, 161, 134, 105, 160, 165],
    actualData: [120, 82, 91, 154, 162, 140, 145]
  },
  messages: {
    expectedData: [200, 192, 120, 144, 160, 130, 140],
    actualData: [180, 160, 151, 106, 145, 150, 130]
  },
  purchases: {
    expectedData: [8000, 10000, 12100, 10400, 10500, 9000, 10000],
    actualData: [12000, 9000, 10000, 13800, 14200, 13000, 13000]
  },
  shoppings: {
    expectedData: [8000, 14000, 14100, 14200, 14500, 15000, 16000],
    actualData: [6000, 8200, 91, 15400, 16200, 14000, 13000]
  }
}

export default {
  name: 'dashboard-admin',
  components: {
    // GithubCorner,
    PanelGroup,
    LineChart,
  },
  data() {
    return {
      lineChartData: lineChartData.newVisitis
    }
  },
  methods: {
    handleSetLineChartData(type) {
      this.lineChartData = lineChartData[type]
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}
</style>
